<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		
	</head>
	<body>
		<h1 id="dao">距离2021年元旦还有:<span>111</span>天<span></span>小时<span></span>分<span></span>秒<span></span>毫秒</h1>
		<script>
			var show=document.getElementById("dao").getElementsByTagName("span");
			setInterval(function(){
			var a=new Date();
			var b=new Date(2021,01,01,00,00,00);
			console.log(b);
				var num=b.getTime() - a.getTime();
				var day=parseInt(num/(24*60*60*1000));
				num=num%(24*60*60*1000);
				var mon=parseInt(num/(60*60*1000));
				num=num%(60*60*1000);
				var fen=parseInt(num/(60*1000));
				num=num%(60*1000);
				var miao=parseInt(num/1000);
				num=num%1000;
				var hao=num;
				show[0].innerHTML=day;
				show[1].innerHTML=mon;
				show[2].innerHTML=fen;
				show[3].innerHTML=miao;
				show[4].innerHTML=hao;
			},100 )
		</script>
	</body>
</html>
